package com.aaa.affair;

import com.aaa.affair.service.BookShopService;
import com.aaa.affair.service.BulkBuying;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/11/14  17:10
 */
public class TestAffair {
    public static void main(String[] args) {

        ApplicationContext app=new ClassPathXmlApplicationContext("spring.xml");
        BookShopService shopService = app.getBean(BookShopService.class);
        shopService.purchase("1002","栗毅");

        /**
         * 批量购买
         */
        /*ApplicationContext app=new ClassPathXmlApplicationContext("spring.xml");
        BulkBuying bean = app.getBean(BulkBuying.class);
        ArrayList<String> list = new ArrayList<>();
        list.add("1001");
        list.add("1002");
        bean.buy(list,"栗毅");*/
    }
}
